<template>
  <div class="log">
      <p>
        <img
        src="https://img.bosszhipin.com/beijin/upload/avatar/20200427/9743d5e87850e514bb000e463723d7ecb4188d951b0217589d0705d4f22256b0_s.jpg?x-oss-process=image/resize,w_100,limit_0"
        alt=""
      />
      </p>
      <p>
          <span>用户注册</span>
      </p>
      <p>
        <input type="text" placeholder="请输入手机号">
      </p>
      <p>
        <input type="text" placeholder="请输入密码">
      </p>
      <p>
        <input type="text" :value="str">
        <button @click="huo()">获取验证码</button>
      </p>
      <p>
        <button @click="log()">已经注册,去登录!</button> 
      </p>
  </div>
</template>

<script>
export default {
  data(){
    return {
      arr:[1,2,3,4,5,6,7,8,9,0],
      newarr:[],
      str:'124534'
    }
  },
    methods:{
        log(){
            this.$router.push('/login')
        },
        huo(){
          this.newarr = []
          while(this.newarr.length < 6) {
            this.num = parseInt(Math.random() * this.arr.length)
            if(this.newarr.indexOf(this.arr[this.num]) == -1) {
              this.newarr.push(this.arr[this.num])
            }
          }
          this.str = this.newarr.join('')
        }
    }
}
</script>

<style scoped>
.log {
    margin: 0.10rem 0.20rem;
    background: #39c0ba;
    overflow: hidden;
}
.log > p {
    display: flex;
    justify-content: center;
    margin: 0.30rem 0;
}
.log > p > img{
    /* width: 100%; */
    width: 1.00rem;
    height: 1.00rem;
    border: 0.01rem solid #fff;
    border-radius: 50%;
}
.log > p > span {
font-size: 0.24rem;
color: #fff;
}
.log > p > input {
    height: 0.30rem;
    border: 0;
    padding-left: 0.10rem;
    border-radius: 0.06rem;
}
.log > p:nth-child(5) > input{
    width: 0.94rem;
    padding: 0 0.10rem;
    margin-right: 0.06rem;
    letter-spacing: 0.04rem;
    text-align: center;
}
.log > p:nth-child(5) > button{
 width: 0.84rem;
  font-size: 0.14rem;
}
.log > p > button {
    background: #3bf282;
    padding: 0.06rem;
    border: 0;
    color: #fff;
    border-radius: 0.06rem;
}
</style>